package objects;

import gui.MainFrame;
import gui.MainPanel;

public class Checker extends Thread{
	private MyShapeBuffers msb;
	private String DS;
	private Drawer drawer;

	Checker (MyShapeBuffers msb) {
		this.msb = msb;
		this.DS = Test.getDS();
		this.drawer = Drawer.getInstance();

	}
	
	public void run() {
		while (Concurrency.f || msb.getCount()>0) {
			if (msb.getCount()>0) {
				MyShape ms = msb.Get();
				if (Concurrency.checkRect() && ms.isRectangle()) {
					System.out.println("prostokat");
					drawer.drawImage(ms);
				}			
				
				if (Concurrency.checkCircle() && ms.isCircle()) {
					
					drawer.drawImage(ms);
				}

			}
		}
		this.interrupt();
	}
	
}
